<extend name="Index/index"/>

<block name="content">
    <!--<div class="view-product" style="margin-top: 50px">-->
        <div class="info-center">
            <div class="manage-head">
                <h6 class="padding-left manage-head-con">{{$title}}</h6>
            </div>
            <div class="offcial-table input-table table-margin clearfix">
                <div class="demoTable">
                    <form action="{{:U('Fee/totalFee')}}" method="get">
                        根据人名搜索：
                        <div class="layui-inline">
                            <input class="layui-input" name="name"  autocomplete="off">
                        </div>
                        根据年份搜索：
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" id="test1" name="year">
                            </div>
                        </div>
                        &nbsp;排序：
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="order" lay-search="" class="form-control">
                                    <option value="f.id" selected>ID</option>
                                    <option value="f.create_time">缴纳时间</option>
                                    <option value="f.price">缴纳金额</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="order1" lay-search="" class="form-control">
                                    <option value="asc" selected>正序</option>
                                    <option value="desc">倒序</option>
                                </select>
                            </div>
                        </div>
                        <input type="submit" value="搜索" class="layui-btn">
                    </form>
                </div>
                <if condition="$feeList eq null">
                    <div class="tr non-info show border-bottom-none">
                        <span>没查询到符合条件的记录</span>
                    </div>
                    <else />
                    <div class="demoTable">
                        <div class="layui-inline">
                            <h3>总金额: <span style="color:#f00;">{{$totalFee}}</span>元</h3>
                        </div>
                    </div>
                    <table class="layui-table text-center">
                        <colgroup>
                            <col width="50">
                            <col width="150">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                        </colgroup>
                        <tr>
                            <th class="text-center">ID</th>
                            <th class="text-center">缴纳人</th>
                            <th class="text-center">金额</th>
                            <th class="text-center">缴纳时间</th>
                            <th class="text-center">缴纳至</th>
                            <th class="text-center">操作</th>
                        </tr>
                        <foreach  name="feeList" item="vo" key="k">
                            <tr>
                                <td>{{$vo.id}}</td>
                                <td>{{$vo.name}}</td>
                                <td>{{$vo.price}}</td>
                                <td>{{:substr($vo['create_time'],0,7)}}</td>
                                <td>{{:substr($vo['effect_time'],0,7)}}</td>
                                <td><span class="layui-btn layui-btn-normal" onclick="changeTime('编辑',this,500,550)">编辑</span></td>
                            </tr>
                        </foreach>
                        <tr>
                            <td colspan="6">
                                <div class="sabrosus">
                                    <if condition="$page neq null">
                                        {{$page}}
                                    </if>
                                </div>
                            </td>
                        </tr>
                    </table>

                </if>

            </div>
        </div>
        <!--<div class="show-page padding-big-right hidden">-->
            <!--<div class="page">-->
            <!--</div>-->
        <!--</div>-->
    <!--</div>-->
    <script>
        layui.use('laydate', function() {
                var laydate = layui.laydate;
                //年选择器
                laydate.render({
                    elem: '#test1'
                    ,type: 'year'
                });
            });
    </script>
    <script charset="utf-8">


        function changeTime(title, obj, w, h) {
            var id = $(obj).parent().parent().find("td").eq(0).text();
            var url = "{{:U('Fee/edit',array('id'=>0))}}";
            url = url.replace(/0/,id);
            layui.use('layer', function() {
                layer.open({

                    type: 2,

                    area: [w + 'px', h + 'px'],

                    fix: false, //不固定

                    maxmin: true,

                    shadeClose: true,

                    shade: 0,
                    scrollbar:false,
                    title: title,

                    content: url

                });
            });

        }

    </script>
</block>